<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

  <form class="form-group" method="POST">
      <label for=""></label>
      <select class="custom-select" name="list" id="">
          <option selected>Select one</option>
          <option value="1">11111</option>
          <option value="2">222222</option>
          <option value="3">3333333</option>
      </select>
      <button type="submit"  action="a()" class="btn btn-primary">Submit</button>
  </form>

</body>

<script type="text/javascript">
function a()
    $.ajax({
    url: "{{ url_for('login') }}",
    type: "post",
    async: true,
    data: JSON.stringify({'username': 'admin', 'password': 'admin'}),
    processData: false,
    contentType: "application/json",
    dataType: "json",
    success: function (data) {
        alert('登录成功!');
    },
    error: function (jqXHR, textStatus, errorThrown) {
        alert('登录失败!');
    }
});

</script>

</html>